export interface AxiosRequestConfig {
    url?: string;
    method?: string;
    baseURL?: string;
    transformRequest?: any;
    transformResponse?: any;
    headers?: any;
    params?: any;
    paramsSerializer?: (params: any) => string;
    data?: any;
    timeout?: number;
    withCredentials?: boolean;
    adapter?: any;
    auth?: any;
    responseType?: string;
    xsrfCookieName?: string;
    xsrfHeaderName?: string;
    onUploadProgress?: (progressEvent: any) => void;
    onDownloadProgress?: (progressEvent: any) => void;
    maxContentLength?: number;
    validateStatus?: (status: number) => boolean;
    maxRedirects?: number;
    httpAgent?: any;
    httpsAgent?: any;
    proxy?: any;
    cancelToken?: any;
}

/*
 * 测试整个sdk的输入和输出
 * 这里重写axios的网络请求方法，把请求的参数返回出去，判断生成的参数是否与期望一致
 */
export default class Axios {
    public static create() {
        return new Axios();
    }

    public static CancelToken(cancelToken) {
        return cancelToken
    }

    public get(url, config) {
        return {
            url,
            config,
        };
    }

    public post(url, data, config) {
        return {
            data,
            url,
            config,
        };
    }

    public put(url, data, config) {
        return {
            data,
            url,
            config,
        };
    }

    public delete(url, config) {
        return {
            url,
            config,
        };
    }

    public patch(url, data, config) {
        return {
            data,
            url,
            config,
        };
    }
}
